package com.local.goods.mapper;

import com.local.goods.pojo.GoodsCategory;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface GoodsCategoryMapper {

    /**
     * 查询分类列表，支持翻页
     * @param parentId
     * @param categoryLevel
     * @param start
     * @param limit
     * @param sort
     * @param order
     * @param isDeleted
     * @return
     */
    public List<GoodsCategory> findGoodsCategoryList(Integer parentId, Byte categoryLevel, Integer start, Integer limit, String sort, String order, Integer isDeleted);


    /**
     * 查询数据的数量
     * @param parentId
     * @param categoryLevel
     * @param isDeleted
     * @return
     */
    public Integer getTotalGoodsCategories(Integer parentId, Byte categoryLevel, Integer isDeleted);


    /**
     * 新增
     * @param goodsCategory
     * @return
     */
    public Integer save(GoodsCategory goodsCategory);

    /**
     * 修改
     * @param goodsCategory
     * @return
     */
    public Integer update(GoodsCategory goodsCategory);


    public Integer deleteByIds(Integer[] ids, Integer updateUserId, String updateTime);

    /**
     * 通过 parent_id 查询分类列表
     * @param parentIds
     * @param categoryLevel
     * @param number
     * @return
     */
    public List<GoodsCategory> selectByLevelAndParentIdsAndNumber(List<Integer> parentIds, Integer categoryLevel, Integer number);


    /**
     * 通过id查询
     * @param categoryId
     * @return
     */
    public GoodsCategory selectById(Integer categoryId);
}
